package com.clz.Control;

import com.clz.dao.UserDao;
import com.clz.entity.User;
import com.clz.util.SqlSessionFactoryUtils;
import org.apache.ibatis.session.SqlSession;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.view.json.MappingJackson2JsonView;

@Controller("/regs")
public class UserControl {
    private SqlSession session= SqlSessionFactoryUtils.getSqlSession();
    private UserDao userDao =session.getMapper(UserDao.class);

//    @RequestMapping("/res")
//    public ModelAndView regs(User user){
//        ModelAndView mv=new ModelAndView();
//        int n= userDao.insertUserS(user);
//        boolean success=n==1;
//        mv.addObject("success",success);
//        mv.setView(new MappingJackson2JsonView());
//        return  mv;
//    }
    @RequestMapping("/toRegs")
    public String toRegs(){
        return "/ftl/htm_ftl/regs";
    }



}
